extends ../../layout/layout

block content
  .content-wrapper
    .search-condition
      .form-inline
        form#form-search
          .form-group
            label.marginR10 编号：
              input.form-control.form-width150(name="planCode", placeholder="请输入名称")
          .form-group
            label.marginR10 合作渠道：
              input.form-control.form-width150(name="cooperationChannel" placeholder="请输入合作渠道")
          .form-group
            label.marginR10 互斥方案：
              select.form-control.form-width100(name="mutualType")
          .form-group
            label.marginR10 有效期：
              input.form-control.form-width200#activeData(name="validityTime", placeholder="请选择时间范围")
    .com-op.marginT10
      button.btn.btn-default.marginR10#btn-search(type="button")
        i.fa.fa-search
        span 查询
      button.btn.btn-default.marginR10#btn-add(type="button")
        i.fa.fa-plus
        span 新建
      button.btn.btn-default.marginR10#btn-detail(type="button")
        //- i.fa.fa-view
        span 查看/编辑

    .content-body.marginT10#table-box
      table.table#table-plan
      #pager-plan



block vendor_css
  link(rel='stylesheet', type="text/css", href="../../vendor/jqGrid/css/ui.jqgrid-bootstrap.css")
  //- link(rel="stylesheet", type="text/css",href="../../css/marketing/project.css")

block vendor_js
  script(src="../../vendor/jqGrid/js/jquery.jqGrid.js")
  script(src="../../vendor/jqGrid/js/i18n/grid.locale-cn.js")
  script(src="../../vendor/laydate/laydate.js")
  script(src="../../vendor/jquery-validation-1.17.0/jquery.validate.min.js")
  script(src="../../vendor/jquery-validation-1.17.0/jquery.validate.extend.js")

block self_js
  script(src="../../js/module/marketing/plan.js")

block self_css
  style.
    #layer-plan { max-height: 600px; overflow: auto; }
    #coupon-list li>label { margin-right: 10px; width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #coupon-list label~input { margin-top: -12px; }


block layer
  //- 营销方案详情
  .layer-box#layer-plan
    form.mw1200.padding20#form-plan(name="form-plan", autocomplete="off")
      +planForm
    //- .text-center.marginB10
      button.btn.btn-primary.marginR10#btn-save(type="button")
        i.fa.fa-save
        span 保存

mixin planForm
  .d-header 基础设置
  .d-content
    .row.form-row.form-row-sm.marginT10
      .col-xs-4
        .form-text 方案编号：
        .form-container
          input.form-control(name="planCode")
      .col-xs-4
        .form-text 邀请码：
        .form-container
          input.form-control(name="invitCode")
      .col-xs-4
        .form-text 编号：
        .form-container
          input.form-control(name="kid", readonly)
      //- .col-xs-4
      //-   .form-text 累加次数：
      //-   .form-container
      //-     input.form-control(name="cumulativeNum")
    .row.form-row.form-row-sm
      .col-xs-4
        .form-text 方案名称：
        .form-container
          input.form-control(name="planName")
      .col-xs-4
        .form-text 合作渠道：
        .form-container
          input.form-control(name="cooperationChannel")
    .row.form-row.form-row-sm
      .col-xs-8
        .form-text 领取上限：
        .form-container.form-inline
          input.form-control(name="receiveLimt")
          | &ensp;次
    .row.form-row.form-row-sm
      .col-xs-6
        .form-text 有效期：
        .form-container
          input.form-control.form-width200#validDate(name="validDate")
          input(type="hidden" name="validityStartTime")
          input(type="hidden" name="validityEndTime")
    .row.form-row.form-row-sm
      .col-xs-6
        .form-text 互斥方案：
        .form-container#sel-mutual-type
          label.marginR10
            input(type="radio", name="mutualType", value="1")
            span &ensp;不互斥
          label.marginR10
            input(type="radio", name="mutualType", value="2")
            span &ensp;全部互斥
          label
            input(type="radio", name="mutualType", value="3")
            span &ensp;指定互斥
    .row.form-row.form-row-sm
      .col-xs-12
        .form-container#plan-list.clearfix
  .d-header
    .form-text 派券方式
  .d-content
    .row.form-row.form-row-sm.marginT10
      .col-xs-12
        .form-text 派券方案：
        .form-container#coupon-list
    .row.form-row.form-row-sm
      .col-xs-10
        .form-text 说明/备注：
        .form-container
          textarea.form-control(name="remark" placeholder="说明与备注信息")
          .text-gray 可详细说明该营销方案的情况

mixin tempLabel
  label.marginR10
    input(type="checkbox", name="",  value="1")
    span &ensp;方案1
  label.marginR10
    input(type="checkbox", name="",  value="2")
    span &ensp;方案2
  label
    input(type="checkbox", name="",  value="3")
    span &ensp;方案3
